home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Especial Multimedia
/
Especial Multimedia.iso
/
Multimed
/
Presenta
/
EV2FREE.ZIP
/
EFREE3.ICZ
/
ICFILES.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-06-14
|
71KB
|
2,142 lines
'Declare Function play% Lib "mhen200.vbx" (ByVal Lin$)
'Declare Sub PlayStop Lib "mhen200.vbx" ()
Declare Function MhASCIIMid% Lib "Muscle.vbx" (a$, ByVal Position%)
Declare Function MhHexStrInt$ Lib "Muscle.vbx" (ByVal Fmt%, IntVal%)
Declare Function MhHexValInt% Lib "Muscle.vbx" (Hexa$)
Declare Function MhReplaceChar$ Lib "Muscle.vbx" (Lin$, ByVal OldChar%, ByVal NewChar%)
Declare Function MhSpecToken$ Lib "Muscle.vbx" (ByVal Which%, Spec$)
Declare Function MhWinDir$ Lib "Muscle.vbx" ()
'Declare Function cvc@ Lib "Muscle.vbx" (ByVal Lin$)
'Declare Function cvd# Lib "Muscle.vbx" (ByVal Lin$)
Declare Function cvi% Lib "Muscle.vbx" (ByVal Lin$)
'Declare Function cvl& Lib "Muscle.vbx" (ByVal Lin$)
'Declare Function cvs! Lib "Muscle.vbx" (ByVal Lin$)
'Declare Function mkc$ Lib "Muscle.vbx" (a@)
'Declare Function mkd$ Lib "Muscle.vbx" (a#)
'Declare Function mki$ Lib "Muscle.vbx" (ByVal a%)
'Declare Function mkl$ Lib "Muscle.vbx" (ByVal l&)
'Declare Function MKS$ Lib "Muscle.vbx" (a!)
Declare Function SetParent% Lib "User" (ByVal hWndChild%, ByVal hWndNewParent%)
'***********************************
' include this module with your Everest external program
' it provides the communications between Everest and your program
' your program acts as a DDE server
' Everest is the DDE destination
'***********************************
' put type declarations here
Type externtype ' header for execute strings
sub As String * 5 ' chr$(0) substitute char
wind As Integer ' window number
rout As Integer ' routine
op As Integer ' operation
obj As Integer ' object
ind As Integer ' index number
hwn As Integer ' window handle
opt As Long ' o$ pointer
atx As Single ' drag drop loc X
aty As Single ' drag drop loc Y
stl As Long ' string length
mid As String * 1 ' message id
err As Integer ' error code (-1 means no error)
End Type
Type ext36type ' continguous memory buffer for externtype
x As String * 36
End Type
Type type242
chr242 As String * 1
i As Integer
End Type
Type type242s
s As String * 3
End Type
Type typecvi
chr242 As String * 1
s As String * 2
End Type
Type type243
chr243 As String * 1
l As Long
End Type
Type type243s
s As String * 5
End Type
Type type244
chr244 As String * 1
s As Single
End Type
Type type244s
s As String * 5
End Type
Type type245
chr245 As String * 1
d As Double
End Type
Type type245s
s As String * 9
End Type
Type type246
chr246 As String * 1
c As Currency
End Type
Type type246s
s As String * 9
End Type
'*************************************
' put constant declarations here
Const yes = -1
Const chr124$ = "|"
Const headlen1% = 37 ' bytes in externtype + 1
'**************************************
' allocate typed vars here
Dim extt As externtype
Dim ext36 As ext36type
Global t242 As type242, t242s As type242s
Global t243 As type243, t243s As type243s
Global t244 As type244, t244s As type244s
Global t245 As type245, t245s As type245s
Global t246 As type246, t246s As type246s
Global tcvi As typecvi
' *************************************
' declare global variables here
Global zr%
Global eq$(127), eqin%, eqout%
Global objids$(-2 To 9, 8), idmap$(8), objn$(8)
Global atts$, attpick$, oats$(8), roats$(8), support$(8), help$(8)
Global tags(), usedtags$
Global mainpath$
Sub ackx ()
' if processing of incoming message will require more
' than 3 seconds, then before beginning processing
' call this routine to acknowledge receipt of message
extt.err = zr%: zr% = yes ' return error code (if any)
extt.stl = -2 ' acknowledgment flag for no change
LSet ext36 = extt ' copy to ext36
em$ = ext36.x
' now substitute for chr$(0) due to DDE inability to transmit chr$(0)
' since em$ is short, a valid subchar will always be available
For subchar% = 254 To 1 Step -1 ' look for 0 substitute candidate
If InStr(em$, Chr$(subchar%)) = 0 Then Exit For ' this one not elsewhere in string
Next
Mid$(em$, 1, 5) = CStr(-subchar%) + " " ' put sub char at start of em$
em$ = MhReplaceChar$(em$, 0, subchar%) ' quickest
' send reply (Everest is waiting for this)
icfiles.Data.Text = em$
End Sub
Sub copx (op%, obj%, con As Control, buf$, pt&, vary)
' "control" operations to/from disk
' op% = 0: concatenate attributes into buf$
' = 1: parse buf$ into attributes
' = 2: control attributes to InfoGrid cells
' = 3: InfoGrid cell to control attribute
' = 8: same as 0, but skip ID attrib
' = 9; same as 1, but skip ID attrib
' =16: same as 0, but instance props only
' =17: same as 1, but instance props only
' =32: same as 0, but return attrib for buf$ in vary
' =33: same as 1, but set attrib buf$ only = to vary
' =64: same as 0, but non-instance props only
' =65: same as 1, but non-instance props only
' 128 bit = form globals
Static lookat%, zaflag%
On Error GoTo ignorecop ' ignore error on next line
conindex% = con.Index ' in case object does not have an .Index
On Error GoTo whoops
tg$ = con.Tag: If Len(tg$) = 1 Then tagval% = Asc(tg$) Else tagval% = Val(tg$)
justone% = (op% And 32) ' reading/setting one attrib only
'Frm% = (op% And 128) ' handling screen form globals
If (op% And 64) Then ' which group of attributes?
Which% = 1 ' non-instance attribs only
xxat% = InStr(oats$(obj%), "XX")
ElseIf (op% And 16) Then
Which% = -1 ' instance attribs only
Else
Which% = 0 ' else ignore instance
End If
Select Case (op% And 7)
Case 0, 2 ' from properties
If justone% Then ' get just one attrib
at$ = buf$ ' buf$ has single attrib we want
maxx% = 2
Else
inst% = yes ' instance attribs always start
oat$ = oats$(obj%) ' oats$() has all attribs
If extt.wind > 0 And zaflag% = 0 Then oat$ = oat$ + roats$(obj%)
at$ = Left$(oat$, 2)
maxx% = Len(oat$)
End If
For x% = 1 To maxx% Step 2
cviat% = cvi(at$)
Select Case Asc(at$)
Case Is < 65
Select Case cviat%
Case cvi("1d")
vary = con.Drive
Case cvi("1i") ' .CurrentItem
vary = con.List(con.ListIndex)
Case cvi("1p")
vary = con.Pattern
Case cvi("2p")
vary = con.Path
End Select
Case Is < 70
Select Case cviat%
'Case 26177 '"Af" ' in tags now 08-16-93
' vary = con.Animation
'Case 26945 '"Ai" ' write only
' vary = con.Additem
Case 27201 '"Aj"
vary = ""
For Y% = con.ListCount To 1 Step -1
vary = Chr$(255) + con.List(Y% - 1) + vary ' use 255 as sep, I guess ok
If Len(vary) > 32000 Then Exit For
Next
'Case 28225 '"An"
' vary = Con.Action ' a write-only property
Case 29761 '"At"
vary = con.Alignment
Case 30017 '"Au"
vary = con.AutoSize
Case 30529 '"Aw"
If obj% = 50 Then
GoSub intags
Else
vary = con.AutoRedraw
End If
''Case 24898 '"Ba"
''vary = con.BoxAlignment
Case 25410 '"Bc"
vary = con.BackColor
''Case 26946 '"Bi"
''vary = con.BevelSizeInner
''Case 27202 '"Bj"
''vary = con.BevelStyleInner
Case 27970 '"Bm"
vary = con.Top + con.Height
Case 28482 '"Bo"
vary = con.BorderColor
Case 29250 '"Br"
vary = con.BorderWidth
Case 29506, 29519 '"Bs", "Os"
vary = con.BorderStyle
''Case 29762 '"Bt"
''vary = con.BorderType
''Case 30274 '"Bv"
''vary = con.BevelSizeInside
''Case 30530 '"Bw"
''vary = con.BevelStyleInside
''Case 30786 '"Bx"
''vary = con.BoxSize
''Case 31042 '"By"
''vary = con.BevelStyle
''Case 31298 '"Bz"
''vary = con.BevelSize
''Case 25411 '"Cc"
''vary = con.TextColor
'Case 25667 '"Cd"
' vary = con.Command
''Case 27715 '"Cl"
''vary = con.Cols
Case 28227 '"Cn"
vary = con.Caption
''Case 29251 '"Cr"
''vary = con.FontEscapement / 10
''Case 29507 '"Cs"
''vary = con.Class
Case 31043 '"Cy"
'''If conindex% > 0 Then
''' Call objmgrx(0, (extt.wind), obj%, conindex%, -1!, -1!, -2, "")
'''Else
'''zr% = -246
'''End If
Call objmgrx(0, (extt.wind), obj%, (extt.ind), -1!, -1!, -2, "")
vary = zr%: zr% = yes
'Case cvi("Dg")
' vary = con.Drag
''Case 27204 '"Dj"
''vary = con.DeviceID
Case 27972 '"Dm"
vary = con.DragMode
''Case 29764 '"Dt"
''vary = con.DeviceType
Case 31044 '"Dy"
'''If conindex% > 0 Then
'''Call objmgrx(2, (extt.wind), obj%, conindex%, -1!, -1!, -2, "")
'''Else
'''zr% = -246
'''End If
Call objmgrx(2, (extt.wind), obj%, (extt.ind), -1!, -1!, -2, "")
vary = zr%: zr% = yes
Case 28229 '"En"
vary = con.Enabled
Case 25925 '"Ee"
'vary = con.Execute ' vb3
Case Else
GoSub intags
End Select
Case Is < 78
Select Case cviat%
Case 12614 '"F1"
vary = con.FontBold
Case 12870 '"F2"
vary = con.FontItalic
''Case 13126 '"F3"
''vary = con.FontStyle
Case 13382 '"F4"
vary = con.FontStrikethru
Case 13638 '"F5"
vary = con.FontTransparent
Case 13894 '"F6"
vary = con.FontUnderline
''Case 25158 '"Fb"
''vary = con.FillBarColor
Case 25414 '"Fc"
vary = con.ForeColor
''Case 25670 '"Fd"
''vary = con.BeginFade
'Case 25926 '"Fe" in tag now, 08-16-93
' vary = con.FileName
Case 26182 '"Ff"
GoSub intags
If Len(vary) = 0 Then timformat% = 2 Else timformat% = Val(vary)
'Case 26438 '"Fg"
' vary = con.FoundString
Case 26950 '"Fi"
vary = con.FillColor
Case 28230 '"Fn"
vary = con.FontName
''Case 28486 '"Fo"
''vary = con.EndFade
Case 29510 '"Fs"
vary = con.FontSize
''Case 29766 '"Ft"
''vary = con.Format
''Case 30022 '"Fu"
''vary = con.FullScreen
''Case 30278 '"Fv"
''vary = con.FillValue
''Case 30790 '"Fx"
''vary = con.FoundIndex
Case 31046 '"Fy"
vary = con.FillStyle
''Case 31302 '"Fz"
''vary = con.Focus
''Case 28743 '"Gp"
''vary = con.Group
''Case 29511 '"Gs"
''vary = con.GaugeStyle
''Case 25672 '"Hd"
''vary = con.StateButton
''Case 29512 '"Hs"
''If extt.wind > 0 Then
''vary = con.HeadingSize
''Else
''GoSub intags
''End If
Case 29768 '"Ht"
vary = con.Height \ Screen.TwipsPerPixelY
Case 30536 '"Hw"
vary = con.hWnd
Case 31304 '"Hz"
vary = con.hDC
''Case 24905 '"Ia"
''vary = con.ColAlignment
''Case 25161 '"Ib"
''vary = con.InnerBottom
Case 25417 '"Ic"
vary = con.ListCount
Case 25673 '"Id"
If (op% And 8) = 0 Then GoSub intags Else vary = ""
Case 25929 '"Ie"
vary = con.List(lookat%)
Case 26953 '"Ii"
vary = con.ListIndex
''Case 27465 '"Ik"
''vary = con.TextColor
''Case 27721 '"Il"
''vary = con.InnerLeft
''Case 28745 '"Ip"
''vary = con.InnerTop
''Case 29257 '"Ir"
''vary = con.InnerRight
''Case 29513 '"Is"
''vary = con.EndLoop
''Case 29769 '"It"
''vary = con.Mask
''Case 31305 '"Iz"
''vary = con.Indent
''Case 28746
''vary = con.JumpCursor
Case 24908 '"La"
vary = lookat%
''Case 25420 '"Lc"
''vary = con.LightColor
''Case 25676 '"Ld"
''vary = con.LastAdded
''Case 29260 '"Lr"
''vary = con.FontOrientation / 10
Case 29516 '"Ls"
vary = con.LargeChange
Case 29772 '"Lt"
vary = con.Left \ Screen.TwipsPerPixelX
''Case 25677 '"Md"
''vary = con.MaxDrop
Case 27725 '"Ml"
vary = con.MultiLine
Case 28237 '"Mn"
vary = con.Min
Case 28749 '"Mp"
vary = con.MousePointer
Case 30285 '"Mv"
vary = CStr(con.Left \ Screen.TwipsPerPixelX) + "," + CStr(con.Top \ Screen.TwipsPerPixelY) + "," + CStr(con.Width \ Screen.TwipsPerPixelX) + "," + CStr(con.Height \ Screen.TwipsPerPixelY)
Case 30797 '"Mx"
vary = con.Max
Case Else
GoSub intags
End Select
Case Is < 84
Select Case cviat%
''Case 28750 '"Np"
''vary = con.NormalCursor
''Case 29263 '"Or"
''vary = con.Orientation
Case 12368 '"P0"
vary = con.Picture
If vary <> 0 Then
vary = ".sp0": GoSub picfyle
SavePicture con.Picture, sep$
End If
''Case 12624 '"P1"
''vary = con.PictureDown
''If vary <> 0 Then
''vary = ".sp1": GoSub picfyle
''SavePicture con.PictureDown, sep$
''End If
''Case 12880 '"P2"
''vary = con.PictureGreyed
''If vary <> 0 Then
''vary = ".sp2": GoSub picfyle
''SavePicture con.PictureGreyed, sep$
''End If
''Case 13136 '"P3"
''vary = con.PictureChecked
''If vary <> 0 Then
''vary = ".sp3": GoSub picfyle
''SavePicture con.PictureChecked, sep$
''End If
''Case 13392 '"P4"
''vary = con.PictureUnChecked
''If vary <> 0 Then
''vary = ".sp4": GoSub picfyle
''SavePicture con.PictureUnChecked, sep$
''End If
''Case 13648 '"P5"
''vary = con.PicturePressed
''If vary <> 0 Then
''vary = ".sp5": GoSub picfyle
''SavePicture con.PicturePressed, sep$
''End If
''Case 13904 '"P6"
''vary = con.PictureUp
''If vary <> 0 Then
''vary = ".sp6": GoSub picfyle
''SavePicture con.PictureUp, sep$
''End If
Case 14672 '"P9"
If con.AutoRedraw Then
vary = ".sp9": GoSub picfyle
SavePicture con.Picture, sep$
End If
''Case 25424 '"Pc"
''vary = con.PassChar
''Case 27728 '"Pl"
''vary = con.Protocol
''Case 29008 '"Pq"
''vary = con.PopupCursor
Case 29264 '"Pr"
vary = con.Interval / 1000
''Case 29776 '"Pt"
''vary = con.Position
''Case 31056 '"Py"
''If extt.wind = 0 Then
''GoSub intags
''Else
''vary = con.Play
''End If
Case 26706 '"Rh"
vary = con.Left \ Screen.TwipsPerPixelX + con.Width \ Screen.TwipsPerPixelX
Case 28498 '"Ro"
If extt.wind = 0 Then
GoSub intags
Else
vary = con.ReadOnly
End If
''Case 30546 '"Rw"
''vary = con.Rows
Case 25171 '"Sb"
vary = con.ScrollBars
''Case 25427 '"Sc"
''vary = con.ShadowColor
''Case 25683 '"Sd"
''vary = con.Device
Case 26707 '"Sh"
vary = con.Shape
''Case 26963 '"Si"
''vary = con.Silent
''Case 27475 '"Sk"
''vary = con.SourceDoc
Case 27731 '"Sl"
vary = con.Style
''Case 27987 '"Sm"
''vary = con.SourceItem
''Case 28499 '"So"
''vary = con.Sound
Case 28755 '"Sp"
vary = con.SmallChange
Case 29011 '"Sq"
If obj% = 50 Then
'wind% = Val(con.Parent.Tag)
'vary = CStr(Ls(wind%).ScaleMode) + "," + CStr(Ls(wind%).ScaleLeft) + "," + CStr(Ls(wind%).ScaleTop) + "," + CStr(Ls(wind%).ScaleWidth) + "," + CStr(Ls(wind%).ScaleHeight)
GoSub intags
Else
vary = CStr(con.ScaleMode) + "," + CStr(con.ScaleLeft) + "," + CStr(con.ScaleTop) + "," + CStr(con.ScaleWidth) + "," + CStr(con.ScaleHeight)
End If
Case 29267 '"Sr"
vary = con.Sorted
Case 29779 '"St"
vary = con.Value
''Case 30547 '"Sw"
''vary = con.ServerShow
Case 30803 '"Sx"
'If TypeOf con Is MhInput Then
'vary = Mid(con.Text, con.SelStart + 1, con.SelLength)
vary = con.SelText
'End If
''Case 31059 '"Sy"
''vary = con.ServerType
''Case 31315 '"Sz"
''vary = con.ServerClass
Case 10323 '"S("
vary = con.SelStart
Case 10579 '"S)"
vary = con.SelLength
Case Else
GoSub intags
End Select
Case Else
Select Case cviat%
''Case 12628 '"T1"
''vary = con.HighColor
''Case 12884 '"T2"
''vary = con.SelectedColor
''Case 24916 '"Ta"
''y% = con.ListCount
''sep$ = String$(y%, "O")
''For y% = y% - 1 To 0 Step -1
''If con.Tagged(y%) Then Mid$(sep$, y% + 1) = "X"
''Next
''vary = sep$: sep$ = ""
''Case 25428 '"Tc"
''vary = con.SelectedCount
''Case 25684 '"Td"
''vary = con.Tagged(lookat%)
Case 26452 '"Tg"
vary = con.Tag
Case 26964 '"Ti"
vary = con.TopIndex
''Case 27732 '"Tl"
''vary = con.TextLen
Case 28500 '"To"
vary = con.TabIndex
Case 28756 '"Tp"
vary = con.Top \ Screen.TwipsPerPixelY
Case 29524 '"Ts"
vary = con.TabStop
Case 29780 '"Tt"
vary = con.Text
Case 31060 '"Ty"
vary = con.MultiSelect
Case 24918 '"Va"
vary = con.Value
''Case 25174 '"Vb"
''vary = con.Verb
Case 25942 '"Ve"
vary = con.Visible
''Case 29782 '"Vt"
''vary = con.VAlignment
Case 26711 '"Wh"
vary = con.Width \ Screen.TwipsPerPixelX
''Case 29271 '"Wr"
''vary = con.WallPaper
Case 30551 '"Ww"
vary = con.WordWrap
Case 22616 '"XX" ' end of instance info flag
If Which% < 0 Then Exit For
vary = nul$
inst% = 0: GoTo skip
Case 22873 '"YY" ' end of displayable attribs
GoTo skip
Case 24922 '"Za"
zaflag% = yes
Call copx(64, obj%, con, buf2$, waste&, vary)
zaflag% = 0
vary = buf2$
Case 28762 '"Zp" ' special internal code to read & set ZOrder without updating .Tag
at$ = "Zo": GoSub intags
If Len(vary) Then
If Val(vary) >= 0 Then con.ZOrder Val(vary)
End If
at$ = "Zp"
Case Else
GoSub intags
End Select
End Select
If VarType(vary) <> 8 Then
ElseIf Len(vary) = 0 Then ' init empties for certain attribs
If InStr("ArBuCbCoEnMaMiNmRoSsTbVe", at$) Then
vary = -1
ElseIf InStr("AcAlAuAwAzCmFuFyKoLuMnMsMxPyReRlRsSaSeSiWlWpWsWtZo", at$) Then
vary = 0
ElseIf cviat% = 29624 Then '"Pr"
vary = "1"
ElseIf cviat% = 25936 Then '"Pe"
vary = "Y"
ElseIf InStr("FfWb", at$) Then
vary = "2"
ElseIf InStr("EtIy", at$) Then
vary = "3"
ElseIf cviat% = 25673 Then '"Id"
vary = conindex%
ElseIf cviat% = 29512 Then '"Hs"
vary = 10
End If
End If
If Which% > 0 Then ' concat non-instance only
If inst% = 0 Then buf$ = buf$ + at$ + fnCompX$(vary)
ElseIf justone% Then
'Call sumerr(zr%) commented out 7-9-93 since prevents program code line from being displayed with error message
Exit Sub ' for speed
Else ' concat into one string
buf$ = buf$ + at$ + fnCompX$(vary)
End If
skip:
at$ = Mid$(oat$, x% + 2, 2) ' prep for next attrib (faster down here)
Next
If justone% = 0 Then buf$ = buf$ + "ZZ" ' end attributes flag
' ******************************************************************
' ********************** set attributes below **********************
' ******************************************************************
Case 1, 3 ' set attrib values
moveit% = 0 ': tagset% = 0
redolist% = 0
sys15% = extt.wind ' faster
If pt& <= 0 Then pt& = 1
If justone% Then ' set just 1
x% = 1: maxx% = 1
Else
x% = 1: maxx% = 999
End If
For x% = 1 To maxx% Step 2
If justone% Then ' vary passed in as parameter
at$ = Left$(buf$, 2)
If Len(at$) = 0 Then
GoTo skip2 ' just in case
ElseIf VarType(vary) <> 8 Then
ElseIf InStr(ynat$, at$) Then
If Len(vary) = 0 Then
ElseIf (Asc(vary) Or 32) = 121 Then
vary = -1
ElseIf (Asc(vary) Or 32) = 110 Then
vary = 0
Else
vary = CInt(Val(vary))
End If
ElseIf InStr("AcAnAtBaBjBsBtBwByEtF3FdFfFoFyGsHaIaIsIyNtOrOsSbSeShSlSyTyVbVtWrWsZo", at$) Then
vary = CInt(Val(vary))
ElseIf InStr("EvJvRv", at$) Then
vary = RTrim$(vary)
ElseIf InStr(COAT$, at$) Then
vary = FixColorx&(vary)
End If
If Which% > 0 Then ' non-instance attribs only
If InStr(oats$(obj%), at$) < xxat% Then GoTo skip2
End If
cviat% = cvi(at$)
Else
at$ = Mid$(buf$, pt&, 2): pt& = pt& + 2
cviat% = cvi(at$)
If cviat% = 23130 Or Len(at$) = 0 Then Exit For ' "ZZ"
'vary = fnExt(buf$, pt&)
typ% = Asc(Mid$(buf$, pt&, 1)): pt& = pt& + 1
If typ% < 240 Then ' short string
vary = Mid(buf$, pt&, typ%)
pt& = pt& + typ%
ElseIf typ% = 240 Then ' empty
vary = Empty
ElseIf typ% = 250 Then ' null
vary = ""
ElseIf typ% = 251 Then ' 0
vary = 0
ElseIf typ% = 242 Then ' int
t242s.s = Mid$(buf$, pt& - 1, 3): LSet t242 = t242s: vary = t242.i
pt& = pt& + 2
ElseIf typ% = 243 Then ' long
t243s.s = Mid$(buf$, pt& - 1, 5): LSet t243 = t243s: vary = t243.l
pt& = pt& + 4
ElseIf typ% = 244 Then ' single
t244s.s = Mid$(buf$, pt& - 1, 5): LSet t244 = t244s: vary = t244.s
pt& = pt& + 4
ElseIf typ% = 245 Then ' double
t245s.s = Mid$(buf$, pt& - 1, 9): LSet t245 = t245s: vary = t245.d
pt& = pt& + 8
ElseIf typ% = 248 Then ' long string
typ% = MhHexValInt%(Mid$(buf$, pt&, 4))
vary = Mid(buf$, pt& + 4, typ%)
pt& = pt& + typ% + 4
ElseIf typ% = 249 Then ' very long string
chars& = CLng(Mid$(buf$, pt&, 5))
vary = Mid(buf$, pt& + 5, chars&)
pt& = pt& + chars& + 5
ElseIf typ% = 246 Then ' currency
t246s.s = Mid$(buf$, pt& - 1, 9): LSet t246 = t246s: vary = t246.c
pt& = pt& + 8
ElseIf typ% = 247 Then ' date
vary = Mid(buf$, pt&, 8)
pt& = pt& + 8
End If
If Which% > 0 Then ' non-instance attribs only
If InStr(oats$(obj%), at$) < xxat% Then GoTo skip2
End If
End If
Select Case Asc(at$)
Case Is < 65
Select Case cviat%
Case cvi("1d")
con.Drive = vary
Case cvi("1p")
con.Pattern = vary
Case cvi("2p")
con.Path = vary
End Select
Case Is < 67
Select Case cviat%
''Case 26177 '"Af"
''z9% = con.Play: con.Play = 0 ' changes legal only when stopped
''con.Animation = "" ' clears old one (if any)
''aas% = (LCase$(Right$(vary, 4)) = ".aas") ' AA script flag
''If InStr(vary, "{") = 0 Then con.Animation = FixDriveV$(vary)
''con.Play = z9%
''GoSub settag
Case 26945 '"Ai"
con.AddItem vary
''Case 28225 '"An"
''con.Action = vary
''GoSub settag
Case 29761 '"At"
If con.Alignment <> vary Then
'''If TypeOf con Is MhInput Then
'''GoSub dumfocus
'''con.Alignment = vary
'''ignoreerr% = yes: con.SetFocus : ignoreerr% = 0
'''Else
con.Alignment = vary
'''End If
End If
Case 30017 '"Au"
If vary <> con.AutoSize Then
con.AutoSize = vary
'''If sys15% = -1 Then Call fmgr2(1, 0, obj%, conindex%, con) ' refresh all windows
End If
Case 30529 '"Aw"
If obj% = 50 Then
GoSub settag
Else
con.AutoRedraw = vary
End If
''Case 24898 '"Ba"
''con.BoxAlignment = vary
Case 25410 '"Bc"
If con.BackColor <> vary Then con.BackColor = vary
'''If (op% And 128) Then
'''If Ls(extt.wind).BackColor <> vary Then Ls(extt.wind).BackColor = vary
'''End If
Case 26178 '"Bf"
''If InStr(vary, "{") = 0 Then
''con.Picture = LoadPicture(FixDriveVx$(vary))
''con.Parent.PicBin.Picture = con.Picture
''End If
''GoSub settag
''Case 26946 '"Bi"
''If con.BevelSizeInner <> vary Then
''con.BevelSizeInner = vary
''End If
''Case 27202 '"Bj"
''con.BevelStyleInner = vary
Case 27970 '"Bm"
con.Height = vary - con.Top
Case 28482 '"Bo"
If con.BorderColor <> vary Then con.BorderColor = vary
'''Case 28738 '"Bp"
'''If extt.wind = 0 Then
'''If LCase$(vary) = "(clear)" Then
'''Ls(0).Picture = LoadPicture("")
'''ElseIf InStr(vary, "{") Then
'''Else 'If LCase$(Right$(vary, 4)) = ".bmp" Then
'''Ls(0).Picture = LoadPicture(FixDriveV$(vary))
'''End If
'''End If
'''GoSub settag
Case 29250 '"Br"
con.BorderWidth = vary
Case 29506 '"Bs"
If con.BorderStyle <> vary Then
con.BorderStyle = vary
End If
''Case 29762 '"Bt"
''If con.BorderType <> vary Then
''con.BorderType = vary
''End If
''Case 30274 '"Bv"
''con.BevelSizeInside = vary
''Case 30530 '"Bw"
''con.BevelStyleInside = vary
''Case 30786 '"Bx"
''con.BoxSize = vary
''Case 31042 '"By"
''con.BevelStyle = vary
''Case 31298 '"Bz"
''con.BevelSize = vary
Case Else
GoSub settag
End Select
Case Is < 70
Select Case cviat%
''Case 25411 '"Cc"
''If con.TextColor <> vary Then con.TextColor = vary
''Case 27715 '"Cl"
''con.Cols = vary
''con.Parent.PicBin.Cols = vary
Case 28227 '"Cn"
If con.Caption <> vary Then con.Caption = vary
''Case 29251 '"Cr"
''con.FontEscapement = vary * 10
''Case 29507 '"Cs"
''con.Class = vary
Case 31043 '"Cy"
zr% = -245
Exit Sub
Case 26436 '"Dg"
con.Drag vary
Case 27972 '"Dm"
con.DragMode = vary
''Case 29764 '"Dt"
''con.DeviceType = vary
Case 31044 '"Dy"
zr% = -245
Exit Sub
Case 25925 '"Ee"
'con.Execute = vary ' vb3
Case 28229 '"En"
con.Enabled = vary
Case Else
GoSub settag
End Select
Case Is < 73
Select Case cviat%
Case 12614 '"F1"
con.FontBold = vary
Case 12870 '"F2"
con.FontItalic = vary
''Case 13126 '"F3"
''con.FontStyle = vary
Case 13382 '"F4"
con.FontStrikethru = vary
Case 13638 '"F5"
con.FontTransparent = vary
Case 13894 '"F6"
con.FontUnderline = vary
''Case 25158 '"Fb"
''If con.FillBarColor <> vary Then con.FillBarColor = vary
Case 25414 '"Fc"
con.ForeColor = vary
''Case 25670 '"Fd"
''con.BeginFade = vary
Case 25926 '"Fe"
If InStr(vary, "{") = 0 Then con.FileName = FixDriveVx$(vary) ': DoEvents causes previous objects to process GotFocus 6-16-93
GoSub settag
Case 26182 '"Ff"
'con.TimeFormat = vary
timformat% = vary
GoSub settag
''Case 26438 '"Fg"
''con.FindString = vary
Case 26950 '"Fi"
If con.FillColor <> vary Then con.FillColor = vary
Case 28230 '"Fn"
If con.FontName <> vary Then
con.FontName = vary
redolist% = yes
End If
''Case 28486 '"Fo"
''con.EndFade = vary
Case 29510 '"Fs"
If con.FontSize <> vary Then
con.FontSize = vary
redolist% = yes
End If
''Case 29766 '"Ft"
''con.Format = vary
''Case 30022 '"Fu"
''con.FullScreen = vary
''Case 30278 '"Fv"
''con.FillValue = vary
''Case 30790 '"Fx"
''con.FoundIndex = vary
Case 31046 '"Fy"
con.FillStyle = vary
''Case 31302 '"Fz"
''con.Focus = vary
''Case 28743 '"Gp"
''con.Group = vary
''Case 29511 '"Gs"
''con.GaugeStyle = vary
''Case 25672 '"Hd"
''con.StateButton = vary
''Case 29512
''If sys15% >= 0 Then
''con.HeadingSize = vary
''Else
''GoSub settag
''End If
Case 29768 '"Ht"
If justone% Then
If TypeOf con Is DriveListBox Then
Else
con.Height = vary * Screen.TwipsPerPixelY
End If
Else
ht! = vary * Screen.TwipsPerPixelY
If con.Height <> ht! Then moveit% = yes
End If
Case Else
GoSub settag
End Select
Case Is < 79
Select Case cviat%
''Case 24905 '"Ia"
''con.ColAlignment = vary
''con.Refresh ' forces update with new alignment
''Case 25161 '"Ib"
''con.InnerBottom = vary
Case 25673 '"Id"
If (op% And 8) = 0 Then GoSub settag
Case 25929 '"Ie"
con.List(lookat%) = vary
Case 26953 '"Ii"
con.ListIndex = vary
''Case 27465 '"Ik"
''If con.TextColor <> vary Then
''con.TextColor = vary
''If obj% = 108 Then
''For y% = con.ListCount - 1 To 0 Step -1
''con.ListTextColor(y%) = vary
''Next
''End If
''End If
''Case 27721 '"Il"
''con.InnerLeft = vary
Case 27977, 27201 '"Im", "Aj"
If Len(vary) = 0 Or justone% <> 0 Then
GoSub comboitems
Else ' else going to have to redo list anyhow
redolist% = yes
End If
GoSub settag
''Case 28745 '"Ip"
''con.InnerTop = vary
''Case 29257 '"Ir"
''con.InnerRight = vary
''Case 29513 '"Is"
''If aas% = 0 Then con.EndLoop = vary
''Case 29769 '"It"
''con.Mask = vary
''Case 31305 '"Iz"
''con.Indent = vary
''Case 28746 '"Jp"
''con.JumpCursor = vary
Case 24908 '"La"
lookat% = vary
''Case 25420 '"Lc"
''con.LightColor = vary
''Case 29260 '"Lr"
''con.FontOrientation = vary * 10
Case 29516 '"Ls"
con.LargeChange = vary
Case 29772 '"Lt"
If justone% Then
con.Left = vary * Screen.TwipsPerPixelX
Else
lt! = vary * Screen.TwipsPerPixelX
If con.Left <> lt! Then moveit% = yes
End If
''Case 25677 '"Md"
''con.MaxDrop = vary
Case 27725 '"Ml"
If con.MultiLine <> vary Then
con.MultiLine = vary
End If
Case 28237 '"Mn"
con.Min = vary
Case 28749 '"Mp"
con.MousePointer = vary
Case 30285 '"Mv"
ReDim mtemp(4): sep$ = vary
Call parseintx(0, sep$, mtemp())
Select Case mtemp(0)
Case 1
con.Move Screen.TwipsPerPixelX * mtemp(1)
Case 2
con.Move Screen.TwipsPerPixelX * mtemp(1), Screen.TwipsPerPixelY * mtemp(2)
Case 3
con.Move Screen.TwipsPerPixelX * mtemp(1), Screen.TwipsPerPixelY * mtemp(2), Screen.TwipsPerPixelX * mtemp(3)
Case 4
If TypeOf con Is DriveListBox Then
con.Move Screen.TwipsPerPixelX * mtemp(1), Screen.TwipsPerPixelY * mtemp(2), Screen.TwipsPerPixelX * mtemp(3)
Else
con.Move Screen.TwipsPerPixelX * mtemp(1), Screen.TwipsPerPixelY * mtemp(2), Screen.TwipsPerPixelX * mtemp(3), Screen.TwipsPerPixelY * mtemp(4)
End If
End Select
Case 30797 '"Mx"
con.Max = vary
''Case 28750 '"Np"
''con.NormalCursor = vary
Case Else
GoSub settag
End Select
Case Is < 82
Select Case cviat%
''Case 29263 '"Or"
''con.Orientation = vary
Case 29519 '"Os"
con.BorderStyle = vary
Case 12368 '"P0"
If Len(vary) > 1 Then
GoSub picfyle2
con.Picture = LoadPicture(sep$)
End If
''Case 12624 '"P1"
''If Len(vary) > 1 Then
''GoSub picfyle2
''con.PictureDown = LoadPicture(sep$)
''End If
''Case 12880 '"P2"
''If Len(vary) > 1 Then
''GoSub picfyle2
''con.PictureGreyed = LoadPicture(sep$)
''End If
''Case 13136 '"P3"
''If Len(vary) > 1 Then
''GoSub picfyle2
''con.PictureChecked = LoadPicture(sep$)
''End If
''Case 13392 '"P4"
''If Len(vary) > 1 Then
''GoSub picfyle2
''con.PictureUnChecked = LoadPicture(sep$)
''End If
''Case 13648 '"P5"
''If Len(vary) > 1 Then
''GoSub picfyle2
''con.PicturePressed = LoadPicture(sep$)
''End If
''Case 13904 '"P6"
''If Len(vary) > 1 Then
''GoSub picfyle2
''con.PictureUp = LoadPicture(sep$)
''End If
''Case 14672 '"P9"
''If Len(vary) > 1 Then
''GoSub picfyle2
''con.Picture = LoadPicture(sep$)
''con.AutoRedraw = yes
''End If
''Case 25424 '"Pc"
''con.PassChar = vary
''Case 25680 '"Pd"
''If InStr(vary, period$) Then
''con.PictureDown = LoadPicture(FixDriveVx$(vary))
''ElseIf Val(vary) > 0 Then
''con.PictureDown = con.Parent.PicBin.GraphicCell(vary - 1)
''ElseIf vary = "0" Then
''con.PictureDown = LoadPicture("")
''End If
''GoSub settag
''Case 26192 '"Pf"
''If InStr(vary, "{") = 0 Then
''z$ = vary
''GoSub intags ' get name of prev picture
''If vary <> z$ Or Len(z$) = 0 Then con.LoadPicture = FixDrivex$(z$)
''vary = z$
''End If
''GoSub settag
''Case 26448 '"Pg"
''If InStr(vary, period$) Then
''con.PictureGreyed = LoadPicture(FixDriveVx$(vary))
''ElseIf Val(vary) > 0 Then
''con.PictureGreyed = con.Parent.PicBin.GraphicCell(vary - 1)
''ElseIf vary = "0" Then
''con.PictureGreyed = LoadPicture("")
''End If
''GoSub settag
''Case 26960 '"Pi"
''If InStr(vary, period$) Then
''con.Picture = LoadPicture(FixDriveVx$(vary))
''ElseIf Val(vary) > 0 Then
''con.Picture = con.Parent.PicBin.GraphicCell(vary - 1)
''ElseIf vary = "0" Then
''con.Picture = LoadPicture("")
''End If
''GoSub settag
''Case 27472 '"Pk"
''If InStr(vary, period$) Then
''con.PictureChecked = LoadPicture(FixDriveVx$(vary))
''ElseIf Val(vary) > 0 Then
''con.PictureChecked = con.Parent.PicBin.GraphicCell(vary - 1)
''ElseIf vary = "0" Then
''con.PictureChecked = LoadPicture("")
''End If
''GoSub settag
''Case 27728 '"Pl"
''con.Protocol = vary
''Case 28240 '"Pn"
''If InStr(vary, period$) Then
''con.PictureUnChecked = LoadPicture(FixDriveVx$(vary))
''ElseIf Val(vary) > 0 Then
''con.PictureUnChecked = con.Parent.PicBin.GraphicCell(vary - 1)
''ElseIf vary = "0" Then
''con.PictureUnChecked = LoadPicture("")
''End If
''GoSub settag
''Case 29008 '"Pq"
''con.PopupCursor = vary
''Case 28752 '"Pp"
''If InStr(vary, period$) Then
''con.PicturePressed = LoadPicture(FixDriveVx$(vary))
''ElseIf Val(vary) > 0 Then
''con.PicturePressed = con.Parent.PicBin.GraphicCell(vary - 1)
''ElseIf vary = "0" Then
''con.PicturePressed = LoadPicture("")
''End If
''GoSub settag
Case 29264 '"Pr"
con.Interval = vary * 1000
''Case 29776 '"Pt"
''con.Position = vary
''Case 30032 '"Pu"
''If InStr(vary, period$) Then
''con.PictureUp = LoadPicture(FixDriveVx$(vary))
''ElseIf Val(vary) > 0 Then
''con.PictureUp = con.Parent.PicBin.GraphicCell(vary - 1)
''ElseIf vary = "0" Then
''con.PictureUp = LoadPicture("")
''End If
''GoSub settag
''Case 31056 '"Py"
''con.Play = vary
''If extt.wind = 0 Then GoSub settag
Case Else
GoSub settag
End Select
Case Is < 84
Select Case cviat%
Case 26706 '"Rh"
con.Width = Screen.TwipsPerPixelX * (vary - con.Left \ Screen.TwipsPerPixelX)
''Case 26962 '"Ri"
''If vary < 0 Then
''con.ClearBox = 0
''Else
''con.RemoveItem vary
''End If
Case 28498 '"Ro"
If extt.wind = 0 Then
GoSub settag
Else
con.ReadOnly = vary
End If
''Case 30546 '"Rw"
''con.Rows = vary
''con.Parent.PicBin.Rows = vary
''Case 25171 '"Sb"
''If con.ScrollBars <> vary Then
''con.ScrollBars = vary
''End If
''Case 25427 '"Sc"
''con.ShadowColor = vary
''Case 25683 '"Sd"
''con.Device = vary
Case 26707 '"Sh"
con.Shape = vary
''Case 26963 '"Si"
''con.Silent = vary
''Case 27475 '"Sk"
''con.SourceDoc = vary
Case 27731 '"Sl"
If con.Style <> vary Then
con.Style = vary
redolist% = yes
vary = con.Style
End If
''Case 27987 '"Sm"
''con.SourceItem = vary
''Case 28499 '"So"
''con.Sound = FixDriveVx$(vary)
Case 29011 '"Sq"
ReDim mtemp(5): sep$ = vary
Call parseintx(0, sep$, mtemp())
If mtemp(0) = 5 Then
If obj% = 50 Then
'wind% = Val(con.Parent.Tag)
'Ls(wind%).ScaleMode = mtemp(1)
'Ls(wind%).Scale (mtemp(2), mtemp(3))-(mtemp(4), mtemp(5))
GoSub settag
Else
con.ScaleMode = mtemp(1)
con.Scale (mtemp(2), mtemp(3))-(mtemp(4), mtemp(5))
End If
End If
Case 28755 '"Sp"
con.SmallChange = vary
Case 29267 '"Sr"
If con.Sorted <> vary Then
'If TypeOf con Is Mh3dList Then cap$ = con.Caption
If obj% = 108 Then cap$ = con.Caption
con.Sorted = vary
redolist% = yes
vary = con.Sorted
'If TypeOf con Is Mh3dList Then con.Caption = cap$
If obj% = 108 Then con.Caption = cap$
End If
Case 29779 '"St"
con.Value = vary
Case 30035 '"Su" ' write only attribute
If vary <> 0 Then con.SetFocus : usedsf% = yes
If vary > 0 Then DoEvents ' let gf%() be updated
''Case 30547 '"Sw"
''con.ServerShow = vary
Case 30803 '"Sx"
con.SelText = vary
''Case 31059 '"Sy"
''con.ServerType = vary
''Case 31315 '"Sz"
''con.ServerClass = vary
Case 10323 '"S("
con.SelStart = vary
Case 10579 '"S)"
con.SelLength = vary
Case Else
GoSub settag
End Select
Case Else
Select Case cviat%
''Case 12628 '"T1"
''If con.HighColor <> vary Then con.HighColor = vary
''Case 12884 '"T2"
''If con.SelectedColor <> vary Then con.SelectedColor = vary
''Case 24916 '"Ta"
''sep$ = vary: y9% = 45
''con.Screenupdate = 0
''z9% = con.ListCount: w9% = con.ListIndex
''For y% = 1 To z9%
''x9% = MhASCIIMid%(sep$, y%)
''If x9% >= 0 Then y9% = x9%
''Select Case y9%
''Case 32, 48, 79, 111
''con.Tagged(y% - 1) = 0
''Case Is <> 45
''con.Tagged(y% - 1) = yes
''End Select
''Next
''con.ListIndex = w9%
''con.Screenupdate = yes
'Case 25428 '"Tc" ' read-only
''Case 25684 '"Td"
''con.Tagged(lookat%) = vary
Case 26452 '"Tg" ' all custom Summit attributes are in Tag
con.Tag = vary
Case 26964 '"Ti"
con.TopIndex = vary
''Case 27732 '"Tl"
''con.TextLen = vary
Case 28500 '"To"
con.TabIndex = vary
Case 28756 '"Tp"
If justone% Then
con.Top = vary * Screen.TwipsPerPixelY
Else
tp! = vary * Screen.TwipsPerPixelY
If con.Top <> tp! Then moveit% = yes
End If
Case 29524 '"Ts"
con.TabStop = vary
Case 29780 '"Tt"
''If TypeOf con Is Mh3dCombo Then
''If con.Style <> 2 Then con.Text = vary ' when style = 2 .text is r/o
''ElseIf TypeOf con Is HEVBLayer Then
''If rtfloaded% = 0 Then con.Text = vary
''Else
con.Text = vary
''End If
Case 31060 '"Ty"
If con.MultiSelect <> vary Then
con.MultiSelect = vary
End If
Case 25685 '"Ud"
If vary Then con.Refresh
Case 24918 '"Va"
con.Value = vary
''Case 25174 '"Vb"
''con.Verb = vary
Case 25942 '"Ve"
con.Visible = vary
Case 26198 '"Vf"
If InStr(vary, "{") = 0 Then con.Picture = LoadPicture(FixDriveVx$(vary))
GoSub settag
''Case 29782 '"Vt"
''con.VAlignment = vary
Case 26711 '"Wh"
If justone% Then
con.Width = vary * Screen.TwipsPerPixelX
Else
wh! = vary * Screen.TwipsPerPixelX
If con.Width <> wh! Then moveit% = yes
End If
''Case 29271 '"Wr"
''con.WallPaper = vary
Case 30551 '"Ww"
con.WordWrap = vary
Case 22616 '"XX" ' end instance info
If Which% < 0 Then Exit For
Case 12378 '"Z0"
'con.SetFocus
con.ZOrder vary
Case 24922 '"Za"
zaflag% = yes
buf2$ = vary
Call copx(65, obj%, con, buf2$, waste&, vary)
zaflag% = 0
Case 25946 '"Ze"
con.Visible = (vary And 1)
con.Enabled = (vary And 2)
'If (vary And 8) = 0 Then
' con.ZOrder Abs((vary And 4) <> 0)
'End If
If (vary And 4) Then con.SetFocus
If (vary And 8) Then con.Refresh
Case 28506 '"Zo"
If extt.wind <> 0 And justone% <> 0 Then
If vary >= 0 Then con.ZOrder vary
End If
'If extt.wind = 0 Or justone% <> 0 Then GoSub settag
GoSub settag
Case Else
GoSub settag
End Select
End Select
skip2:
Next
If redolist% = 0 Then
''ElseIf TypeOf con Is Mh3dCombo Then
''GoSub redocombo
''ElseIf obj% = 108 Then
''GoSub redocombo
End If
If moveit% Then
If TypeOf con Is DriveListBox Then
con.Move lt!, tp!, wh!
Else
con.Move lt!, tp!, wh!, ht!
End If
End If
If (op% And 8) = 1 Then at$ = "Id": GoSub intags ' return ID# in vary
End Select
'''If sys15% < 0 Then Call sumerr(zr%)
Exit Sub
redocombo:
at$ = "Im": GoSub intags
If Len(vary) = 0 Then Return ' else fall through
comboitems:
''con.Screenupdate = 0
''con.ClearBox = 0
''sep$ = Left$(vary, 1)
''If Len(sep$) Then
''impt% = 2
''Do
''impt2% = InStr(impt%, vary, sep$): If impt2% = 0 Then impt2% = Len(vary) + 1
''con.AddItem Mid$(vary, impt%, impt2% - impt%)
''impt% = impt2% + 1
''Loop While impt% <= Len(vary)
''End If
''con.Screenupdate = yes
Return
dumfocus:
''wasignore% = ignoreerr%: ignoreerr% = yes
''Ls(extt.wind).focusdummy.SetFocus
''ignoreerr% = wasignore%
Return
intags:
where% = InStr(tags(0, tagval%), at$)
If where% Then vary = tags(where% \ 2 + 1, tagval%) Else vary = nul$
Return
picfyle:
''vary = Right$("00" + Hex$(conindex%), 2) + Hex$(sysvar(130)) + vary
''vary = CStr(extt.wind) + Chr$(obj%) + vary
picfyle2:
''If Len(sysvar(56)) Then
''sep$ = MhSpecToken$(3, FixDriveV$(sysvar(56))) + vary
''Else
''sep$ = mainpath$ + vary
''End If
Return
settag:
where% = InStr(tags(0, tagval%), at$)
If where% = 0 Then tags(0, tagval%) = tags(0, tagval%) + at$: where% = Len(tags(0, tagval%)) - 1
tags(where% \ 2 + 1, tagval%) = vary
Return
whoops:
If ignoreerr% Then Resume Next
zr% = Err
''zrs$ = "Attribute: " + at$ + ", " + FnAtFind(0, at$)
If (op% And 1) Then zrs$ = zrs$ + crlf$ + "Illegal Value: " & vary
MsgBox Str$(zr%) + at$ + zrs$, 4096
Resume Next
ignorecop:
If buf$ = "Cy" Then
sep$ = Error$
conindex% = Val(Mid$(sep$, InStr(sep$, "'") + 1))
Else
conindex% = 1
End If
Resume Next
End Sub
Sub extmgrx (op%, em$)
' op% = 1: process incoming em$ execute string
chr0$ = Chr$(0)
If op% = 1 Then
' first put chr 0 at proper places in em$
u& = Val(Left$(em$, 5)) ' get chr0$ sub technique
If u& < 0 Then ' < 0 means sub code
subchar% = Abs(u&)
em$ = MhReplaceChar$(em$, subchar%, 0) ' replace sub with 0
Else
zl$ = Mid$(em$, headlen1% + u&) ' header + em$ to start of zl$
Do ' loop through zero list
make0% = Val(zl$): If make0% <= 0 Then Exit Do
Mid$(em$, make0%) = chr0$
pt% = InStr(zl$, chr124$): If pt% = 0 Then Exit Do
zl$ = Mid$(zl$, pt% + 1)
Loop
End If
' load em$ header into extt
ext36.x = em$: LSet extt = ext36
If extt.stl > 0 Then ' if there is string info
em$ = Mid$(em$, headlen1%, extt.stl) ' this is the string
ept& = 1
buf$ = fnExtx(em$, ept&) ' uncompress the string
vary = fnExtx(em$, ept&) ' there are actually two
End If
' copy commonly used vars from header
wind% = extt.wind ' Everest window number
obj% = extt.obj And 7 ' object code number
op% = extt.op ' desired operation
ind% = extt.ind ' object ID# in Everest
zr% = extt.err ' current error code
' perform the action indicated by extt.rout
'icfiles!Label1.Caption = Str$(Len(em$)) + Str$(Timer)
Select Case extt.rout ' desired routine
Case 2 ' call control operations
localid% = mapid%(2, wind%, obj%, ind%)
'If localid% <= 0 Then zr% = -246: buf$ = Str$(localid%): GoTo returning
Select Case obj% ' diff call needed for each object
Case 0
Call copx(op%, obj%, icfiles.Drive1(localid%), buf$, waste&, vary)
Case 1
Call copx(op%, obj%, icfiles.Dir1(localid%), buf$, waste&, vary)
Case 2
Call copx(op%, obj%, icfiles.File1(localid%), buf$, waste&, vary)
End Select
'If op% = 0 Then
' MsgBox "Zero!", 4096
'End If
If (op% And 1) Then nochange% = yes ' no new info to return
Case 1 ' call object manager
If op% = 0 Then buf$ = ""
Call objmgrx(op%, wind%, obj%, ind%, extt.atx, extt.aty, atscript%, buf$)
nochange% = yes
Case 0 ' send attribute descriptions & help file
mainpath$ = buf$ ' Everest sends path of screen library
buf$ = fnCompX(attpick$) + fnCompX(atts$)
vary = "Everest1" ' must have this signature
Case -1 ' send object descriptions
buf$ = fnCompX(objn$(obj%)) + fnCompX(oats$(obj%)) + fnCompX(roats$(obj%))
vary = fnCompX(support$(obj%)) + fnCompX(help$(obj%))
If Len(objn$(obj%)) Then icfiles!pic1.Picture = icfiles!Image1(obj%).Picture
Case Else ' for future routine codes
buf$ = ""
vary = ""
End Select
' prepare return information
returning:
extt.err = zr%: zr% = yes ' return error code (if any)
If nochange% Then ' buf$ & vary not changed
extt.stl = -1 ' flag for no change
LSet ext36 = extt ' copy to ext36
em$ = ext36.x
ElseIf Len(buf$) = 0 And Len(vary) = 0 Then
extt.stl = 0
LSet ext36 = extt ' copy to ext36
em$ = ext36.x
Else
chars& = Len(buf$)
Select Case chars&
Case 0& ' null string
em$ = Chr$(250) + fnCompX(vary)
Case Is < 240& ' short string
em$ = Chr$(chars&) + buf$ + fnCompX(vary)
Case Is < 32000 ' medium string, use hex
em$ = Chr$(248) + Right$("0000" + Hex$(chars&), 4) & buf$ & fnCompX(vary)
Case Else
em$ = Chr$(248) + Right$("0000" + Hex$(32000), 4) & Left$(prop, 32000) & fnCompX(vary)
extt.err = -277 ' string too long
End Select
extt.stl = Len(em$) ' string length
LSet ext36 = extt ' copy to ext36
em$ = ext36.x + em$ ' tack on string
End If
' now substitute for chr$(0) due to DDE inability to transmit chr$(0)
For subchar% = 254 To 1 Step -1 ' look for 0 substitute candidate
If InStr(em$, Chr$(subchar%)) = 0 Then Exit For ' this one not elsewhere in string
Next
If subchar% Then ' sub avail
Mid$(em$, 1, 5) = CStr(-subchar%) + " " ' put sub char at start of em$
em$ = MhReplaceChar$(em$, 0, subchar%) ' quickest
Else ' no sub, must create list (slow!)
Mid$(em$, 1, 5) = CStr(extt.stl) + " " ' save original em$ len
pt% = 0
Do ' loop & build zero list
pt% = InStr(pt% + 1, em$, chr0$)
zl$ = zl$ + CStr(pt%) + chr124$
Mid$(em$, pt%) = "*" ' anything but chr$(0)
Loop
em$ = em$ + zl$ ' put zero list on end
End If
' send reply (Everest is waiting for this)
'icfiles!label2.Caption = Str$(Len(em$)) + Str$(Timer)
icfiles!Data.Text = em$
' the following two apply during an Everest shutdown
Select Case extt.rout
Case -2 ' author removed
DoEvents
End
Case -3 ' program ending
DoEvents
End
End Select
End If
End Sub
Function FixColorx& (incolor)
' convert hex format incolor string to numeric form
On Error Resume Next
If Len(incolor) >= 10 Then
FixColorx& = Val(Left$(incolor, 10))
Else
z& = Val(incolor)
If z& < 0 Then
FixColorx& = z& + 65536
Else
FixColorx& = z&
End If
End If
End Function
Function FixDirx$ (inny$)
' convert inny$ subdirectory path to end with : or \
pt% = InStr(inny$, "[")
If pt% Then ' ditch [ ] in path
temp$ = RTrim$(Left$(inny$, pt% - 1))
pt% = InStr(inny$, "]"): If pt% = 0 Then pt% = Len(inny$)
inny$ = temp$ + LTrim$(Mid$(inny$, pt% + 1))
End If
If Len(inny$) <= 2 Then
FixDirx$ = UCase$(inny$)
ElseIf Right$(inny$, 1) <> "\" Then
FixDirx$ = UCase$(inny$) + "\"
Else
FixDirx$ = UCase$(inny$)
End If
End Function
Function FixDriveVx$ (vary As Variant)
' call FixDrive, but pass in variant
inny$ = vary
FixDriveVx$ = FixDrivex$(inny$)
End Function
Function FixDrivex$ (inny$)
' adjust disk path of file from Everest specifications
' if no path, prefix MAINPATH$
' if drive letter is ?, replace with MAINPATH$ drive letter
' if drive letter is @, replace with current DOS default path
' if drive letter is &, replace with Windows path
char1% = MhASCIIMid%(inny$, 1)
char2% = MhASCIIMid%(inny$, 2)
If char1% = 92 And char2% = 92 Then ' \\network\sharename\sub\filename
FixDrivex$ = inny$
ElseIf char2% <> 58 Then ' not colon$ ":"
If Len(inny$) Then FixDrivex$ = mainpath$ + inny$
Else
char3% = MhASCIIMid%(inny$, 3)
Select Case char1%
Case 63 ' "?"
If char3% = 92 Then
FixDrivex$ = Left$(mainpath$, 1) + Mid$(inny$, 2)
Else
FixDrivex$ = mainpath$ & Mid$(inny$, 3)
End If
Case 64 ' "@"
If char3% = 92 Then
FixDrivex$ = Left$(CurDir$, 1) + Mid$(inny$, 2)
Else
FixDrivex$ = FixDirx$(CurDir$) + MhSpecToken$(6, inny$)
End If
Case 38 ' "&"
If char3% = 92 Then
FixDrivex$ = Left$(MhWinDir$(), 1) + Mid$(inny$, 2)
Else
FixDrivex$ = FixDirx$(MhWinDir$()) + MhSpecToken$(6, inny$)
End If
Case Else
FixDrivex$ = inny$
End Select
End If
End Function
Function fnCompX$ (prop As Variant)
' "compress" prop into a string (for object property storage)
' this is the opposite of fnExtx
typ% = VarType(prop)
If typ% < 2 Then ' 240=empty, 241=Null
fnCompX$ = Chr$(240 + typ%)
ElseIf typ% = 8 Then ' string
chars& = Len(prop)
Select Case chars&
Case 0& ' null string
fnCompX$ = Chr$(250)
Case Is < 240& ' short string
fnCompX$ = Chr$(chars&) + prop
Case Is < 32000 ' medium string, use hex
fnCompX$ = Chr$(248) + Right$("0000" + Hex$(chars&), 4) & prop
Case Else
fnCompX$ = Chr$(248) + Right$("0000" + Hex$(32000), 4) & Left$(prop, 32000)
zr% = -277
End Select
ElseIf typ% < 7 And prop = 0 Then ' numeric 0
fnCompX$ = Chr$(251)
ElseIf typ% = 2 Then ' int (short)
t242.i = prop: LSet t242s = t242
fnCompX$ = t242s.s
ElseIf typ% = 3 Then ' int (long)
t243.l = prop: LSet t243s = t243
fnCompX$ = t243s.s
ElseIf typ% = 4 Then ' single
t244.s = prop: LSet t244s = t244
fnCompX$ = t244s.s
ElseIf typ% = 5 Then ' double
t245.d = prop: LSet t245s = t245
fnCompX$ = t245s.s
ElseIf typ% = 6 Then ' currency
t246.c = prop: LSet t246s = t246
fnCompX$ = t246s.s
Else ' date (8 bytes) or newtype
fnCompX$ = Chr$(240 + typ%) & prop
End If
End Function
Function fnExtx (s$, pt&)
' "extend" s$ (uncompress) and return as variant
' this is the opposite of fnCompx
On Error GoTo fnExtxerr
typ% = Asc(Mid$(s$, pt&, 1)) ': pt& = pt& + 1
If typ% < 240 Then ' short string
pt& = pt& + 1
fnExtx = Mid(s$, pt&, typ%)
pt& = pt& + typ%
ElseIf typ% = 240 Then ' empty
pt& = pt& + 1
fnExtx = Empty
ElseIf typ% = 250 Then ' null
pt& = pt& + 1
fnExtx = ""
ElseIf typ% = 251 Then ' 0
pt& = pt& + 1
fnExtx = 0
ElseIf typ% = 242 Then ' int
t242s.s = Mid$(s$, pt&, 3): LSet t242 = t242s
fnExtx = t242.i
pt& = pt& + 3
ElseIf typ% = 243 Then ' long
t243s.s = Mid$(s$, pt&, 5): LSet t243 = t243s
fnExtx = t243.l
pt& = pt& + 5
ElseIf typ% = 244 Then ' single
t244s.s = Mid$(s$, pt&, 5): LSet t244 = t244s
fnExtx = t244.s
pt& = pt& + 5
ElseIf typ% = 245 Then ' double
t245s.s = Mid$(s$, pt&, 9): LSet t245 = t245s
fnExtx = t245.d
pt& = pt& + 9
ElseIf typ% = 248 Then ' long string
pt& = pt& + 1
fnExtx = Mid(s$, pt& + 4, Val("&H" + Mid$(s$, pt&, 4)))
pt& = pt& + typ% + 4
ElseIf typ% = 249 Then ' very long string
pt& = pt& + 1
chars& = CLng(Mid$(s$, pt&, 5))
fnExtx = Mid(s$, pt& + 5, chars&)
pt& = pt& + chars& + 5
ElseIf typ% = 246 Then ' currency
t246s.s = Mid$(s$, pt&, 9): LSet t246 = t246s
fnExtx = t246.c
pt& = pt& + 9
ElseIf typ% = 247 Then ' date
pt& = pt& + 1
fnExtx = Mid(s$, pt&, 8)
pt& = pt& + 8
End If
fnExtxbot:
Exit Function
fnExtxerr:
fnExtx = ""
Resume fnExtxbot
End Function
Sub init ()
'
' put your custom attribute descriptions in ATTS$
' format is |#x.Description|
' where # is a digit from 0 to 9
' x is a lower-case letter from a to z
atts$ = "|1d.Drive|1p.Pattern|1i.CurrentItem|2p.Path|"
' put Attribute window drop down list choices in ATTPICK$
' format is |#xItem1,Item2|
' where #x is the same identifier used in ATTS$
' for color dialog, make Item1 Color
' for font dialog, make Item1 Font
' for files dialog, start Item1 with *
attpick$ = ""
' put your object descriptions here
' objn$(#) = object name
' oats$(#) = object design time attributes
' roats$(#) = additional attributes to be saved with user bookmark
' support$(#) = list of external files needed by object, use comma to separate multiple file names
' help$(#) = name of on-line author help file (if any)
' where # is a number from 0 to 7
' Drives
objn$(0) = "Drives"
'oats$(0) = "TpLtWhHtIdCoXXIyFcBcFnFsF1TsHeYY1d" ' VB has fontname & fontsize bug in this object
oats$(0) = "TpLtWhHtIdCoXXIyFcBcF1TsHeYY1d"
roats$(0) = "VeMp"
support$(0) = "icfiles.exe,vbrun300.dll"
help$(0) = ""
' Dir
objn$(1) = "DirList"
oats$(1) = "TpLtWhHtIdCo2pXXIyFcBcFnFsF1TsHeCe"
roats$(1) = "VeMp"
support$(1) = "icfiles.exe,vbrun300.dll"
help$(1) = ""
' FileList
objn$(2) = "FileList"
oats$(2) = "TpLtWhHtIdCo1p2pXXIyFcBcFnFsF1TsCeDc"
roats$(2) = "VeMp"
support$(2) = "icfiles.exe,vbrun300.dll"
help$(2) = ""
End Sub
Function mapid% (op%, wind%, obj%, ind%)
' convert the object ID# number used in Everest
' op% = 1: create new, return object's index
' = 2: look up, return object's index
' = 3: unload
' = 4: return Ls wind% number given object's ind%
' = 5: return Ls ind% number given object's ind%
look$ = Chr$(254) + Chr$(wind% + 2) + Chr$(ind%)
If op% = 1 Then
x% = InStr(idmap$(obj%), String$(3, 0))
If x% = 0 Then
x% = Len(idmap$(obj%)) \ 3 + 1
idmap$(obj%) = idmap$(obj%) + look$
Else
Mid$(idmap$(obj%), x%) = look$
x% = (x% + 2) \ 3
End If
mapid% = x%
ElseIf op% = 2 Then
mapid% = (InStr(idmap$(obj%), look$) + 2) \ 3
ElseIf op% = 3 Then
x% = InStr(idmap$(obj%), look$)
If x% Then
Mid$(idmap$(obj%), x%) = String$(3, 0)
x% = (x% + 2) \ 3
End If
mapid% = x%
ElseIf op% = 4 Then
mapid% = MhASCIIMid%(idmap$(obj%), ind% * 3 - 1) - 2
ElseIf op% = 5 Then
mapid% = MhASCIIMid%(idmap$(obj%), ind% * 3)
End If
End Function
Sub objmgrx (op%, wind%, obj%, ind%, atx As Single, aty As Single, atscript%, o$)
' op% = 0: add object to Script & ls(wind%)
' = 1: delete object in script line atscript%
' = 2: unload object obj% with index ind%
' = 3: same as 2
' =-1: same as 0, except load into index% 0 (no Script), make sure fromcpb% = -1
'
' len(o$) > 0: loading object specified in screen script
' fromcpb% > 0: pasting from cut/paste buffer, >=0 enable & make visible
' atx >= 0 And aty >= 0: dragged to ls(wind%) from ToolSet
'
waszr% = zr%: zr% = yes
If op% <= 0 Then
wto% = wind% ' default
If op% = -3 Then ' pasting
Action% = 2
ElseIf op% = -2 Then ' loading from o$
Action% = 1
ElseIf op% < 0 Then
Action% = op%
ElseIf Len(o$) Then ' loading from disk
Action% = 1
ElseIf atx >= 0 And aty >= 0 Then ' dragged from ToolSet to VisualScreen
Action% = 4: copyop% = 0
Else ' dragged from ToolSet to IconScript, or double clicked on ToolSet
'''Action% = 5: copyop% = 1
'''atx = Ls(wind%).Width \ 2 \ sysvar(2): aty = Ls(wind%).Height \ 2 \ sysvar(3)
End If
If Action% < 0 Then
Index% = 0
opt& = 28
z$ = fnExtx(o$, opt&) ' skip comment stored with object
ElseIf Len(objids$(wind%, obj%)) >= 100 Then ' up to 99 of each object classs per screen
zr% = -239: Exit Sub
ElseIf obj% >= 0 Then
Class$ = Chr$(obj%)
If ind% > 0 Then
Index% = ind%
Else
For Index% = 1 To 99 ' find avail index (control array)
If InStr(objids$(wind%, obj%), Chr$(Index%)) = 0 Then
Exit For
End If
Next
If Index% > 99 Then zr% = -239: Exit Sub
End If
Else
zr% = -232: zrs$ = CStr(obj%): Exit Sub ' else bad object number
End If
If Action% < 0 Then
ElseIf Action% = 1 Then
opt& = 1: lyn% = atscript%
End If
If wind% = 0 Or wind% = -1 Then 'And fromcpb% >= 0 Then
enable% = yes
Else
enable% = 0
End If
cto% = Index%
If zr% <> -1 Then obj% = -1
If obj% < 0 Then
zr% = yes
End If
If cto% <= 0 Or InStr(objids$(wind%, obj%), Chr$(cto%)) > 0 Then
newcon% = 0
ElseIf obj% = 76 Then ' JLabel has no tags
newcon% = yes
Else
newcon% = yes ' DoEvents can help with unnecessary focus event
newtag = InStr(usedtags$, " ")
If newtag = 0 Then
usedtags$ = usedtags$ + "X"
newtag = Len(usedtags$)
If newtag > UBound(tags, 2) Then ReDim Preserve tags(39, newtag + 7)
Else
Mid(usedtags$, newtag) = "X"
End If
If newtag < 256 Then newtag = Chr$(newtag) Else newtag = CStr(newtag)
End If
Select Case obj%
Case 0 ' Drive list
If newcon% Then
localid% = mapid%(1, wto%, obj%, cto%)
Load icfiles.Drive1(localid%)
x% = SetParent(icfiles.Drive1(localid%).hWnd, extt.hwn)
icfiles.Drive1(localid%).Tag = newtag
End If
If Action% <= 2 Then ' from disk
Call copx(1, obj%, icfiles.Drive1(localid%), o$, opt&, vwaste)
Else
icfiles.Drive1(localid%).Move Screen.TwipsPerPixelX * atx, Screen.TwipsPerPixelY * aty
End If
If enable% Then
icfiles.Drive1(localid%).Enabled = yes
icfiles.Drive1(localid%).Visible = yes
End If
Case 1 ' Directory list
If newcon% Then
localid% = mapid%(1, wto%, obj%, cto%)
Load icfiles.Dir1(localid%)
x% = SetParent(icfiles.Dir1(localid%).hWnd, extt.hwn)
icfiles.Dir1(localid%).Tag = newtag
End If
If Action% <= 2 Then ' from disk
Call copx(1, obj%, icfiles.Dir1(localid%), o$, opt&, vwaste)
Else
icfiles.Dir1(localid%).Move Screen.TwipsPerPixelX * atx, Screen.TwipsPerPixelY * aty
End If
If enable% Then
icfiles.Dir1(localid%).Enabled = yes
icfiles.Dir1(localid%).Visible = yes
End If
Case 2 ' File list
If newcon% Then
localid% = mapid%(1, wto%, obj%, cto%)
Load icfiles.File1(localid%)
x% = SetParent(icfiles.File1(localid%).hWnd, extt.hwn)
icfiles.File1(localid%).Tag = newtag
End If
If Action% <= 2 Then ' from disk
Call copx(1, obj%, icfiles.File1(localid%), o$, opt&, vwaste)
Else
icfiles.File1(localid%).Move Screen.TwipsPerPixelX * atx, Screen.TwipsPerPixelY * aty
End If
If enable% Then
icfiles.File1(localid%).Enabled = yes
icfiles.File1(localid%).Visible = yes
End If
End Select
If obj% >= 0 Then
If newcon% Then objids$(wind%, obj%) = objids$(wind%, obj%) + Chr$(cto%)
ind% = cto%
End If
ElseIf op% = 1 Or op% = 2 Or op% = 3 Then ' delete object
Index% = ind%
localid% = mapid%(3, wind%, obj%, Index%)
If localid% > 0 Then
Select Case obj%
Case 0
oldtag$ = icfiles.Drive1(localid%).Tag
Unload icfiles.Drive1(localid%)
Case 1
oldtag$ = icfiles.Dir1(localid%).Tag
Unload icfiles.Dir1(localid%)
Case 2
oldtag$ = icfiles.File1(localid%).Tag
Unload icfiles.File1(localid%)
End Select
Else
zr% = -246
End If
If Len(oldtag$) = 1 Then ot% = Asc(oldtag$) Else ot% = Val(oldtag$)
If ot% > 0 Then
Mid(usedtags$, ot%) = " "
x% = Len(tags(0, ot%)) \ 2 + 1
For x% = x% To 0 Step -1: tags(x%, ot%) = Empty: Next
End If
'If op% = 1 Or op% = 2 Then
Index% = InStr(objids$(wind%, obj%), Chr$(Index%))
If Index% > 0 Then
objids$(wind%, obj%) = Left$(objids$(wind%, obj%), Index% - 1) + Mid$(objids$(wind%, obj%), Index% + 1)
End If
'End If
End If
objmgrbot:
zr% = waszr%
End Sub
Sub parseintx (op%, z$, a() As Variant)
' parse comma delimited z$, return pieces in array a()
maxcount% = UBound(a)
For Count% = 1 To maxcount%
pt% = pt2% + 1: pt2% = InStr(pt%, z$, ",")
If pt2% Then
p$ = Mid$(z$, pt%, pt2% - pt%)
Else
p$ = Mid$(z$, pt%)
End If
valp = Val(p$)
If p$ = "0" Or valp <> 0 Then
a(Count%) = valp
Else
a(Count%) = p$
End If
If pt2% = 0 Then Exit For
Next
a(0) = Count% ' number of parameters found
End Sub
Sub sendevent (evcode$, obj%, ind%, xtra$)
' send an event to Everest
' uses the eq$() event queue to buffer events
Static inthissub%
eq$(eqin%) = evcode$ + Chr$(obj% + 8) + Chr$(mapid%(4, 0, obj%, ind%) + 8) + Chr$(mapid%(5, 0, obj%, ind%) + 8) + xtra$
eqin% = eqin% + 1
If eqin% > 127 Then eqin% = 1
If inthissub% Then Exit Sub
inthissub% = yes
Do While eqout% <> eqin%
If Len(eq$(eqout%)) Then
icfiles.Events.Text = eq$(eqout%)
eq$(eqout%) = ""
t = Timer + 1: If t > 86400 Then t = 1 ' loop for up to one second
Do
DoEvents ' allow Everest to clear .Text after receiving it
If Len(icfiles.Events.Text) = 0 Then Exit Do
Loop While Timer < t
End If
eqout% = eqout% + 1
If eqout% > 127 Then eqout% = 1
Loop
inthissub% = 0
End Sub